package com.wk.springboot.file.constant;

import java.io.File;
import org.apache.commons.lang.StringUtils;

/**
 * @Classname DiskPathConstant
 * @Description TODO
 * @Date 2019/11/28 15:45
 * @Author by weikai
 */
public final class DiskPathConstant {

  private DiskPathConstant() {
  }

  /**
   * 操作系统path
   */
  private static final String OS_PATH ;

  private static String basePath;
  //获取操作系统信息
  static {
    OS_PATH = System.getProperty("os.name");
    if(StringUtils.contains(OS_PATH,"Windows")){
      basePath = "C:";
    }else {
      basePath = "";
    }
  }
  /**
   * 基础路径："/cscl/disk/"
   */
  public static final String BASE_PATH = basePath + File.separator+"cscl"+ File.separator+"disk"+ File.separator;

  /**
   * 接收端的标识
   */
  public static final String RECEIVE = "RECEIVE_PART";

  /**
   * 发送端标识
   */
  public static final String SEND = "SEND_PART";

  /**
   * 接收应用系统平台返回报文的路径
   */
  public static final String SEND_RETURN = "SEND_RETURN";

  /**
   * 存放本平台返回报文的路径
   */
  public static final String RECEIVE_RETURN = "RECEIVE_RETURN";

  /**
   * 返回文件前缀
   */
  public static final String PREFIX_RETURN = "RETURN_";

  /**
   * 临时文件的后缀名
   */
  public static final String TMP = ".tmp";


  /**
   * 监听接收端路径
   */
  public static final String RECEIVE_DIR = BASE_PATH + RECEIVE + File.separator;


  /**
   * 发送端接收返回报文路径
   */
  public static final String SEND_RETURN_DIR = BASE_PATH + SEND_RETURN + File.separator;

  /**
   * 接收端存放报文路径
   */
  public static final String RECEIVE_RETURN_DIR = BASE_PATH + RECEIVE_RETURN + File.separator;

  /**
   * 发送端路径
   */
  public static final String SEND_DIR = BASE_PATH + SEND + File.separator;

  /**
   * 定时间隔
   */
  public static final Integer INTERVAL_TIME = 500;
}
